06/06, 2022

Introduction

What is reproducible research?

  • Interlaced code, data (Raw) and text
  • Repos on github
  • in R: Rmarkdown (Rmd)

Reproducibility en R

  1. A folder
    • Raw data (csv, xls, html, json)
    • Code and text (Rmd, Rpres, shiny)
    • Results (Manuscript, Web Page, App)

Some motivation

External Resources

Objectives

Objectives

  • Part 1: Set up the project and rmarkdown basics
  • Part 2: getting the most of your rmd by using interactive HTML
  • Part 3: Reusing code for presentations and PDfs

Part 1 Set up the project and rmarkdown basics

In this part

  • Start a new project
  • Generate your github repo
  • Generate your readme file
  • Simple html report

Start a new project and generate your github repo

usethis::use_git()
# set your credentials if you must
gitcreds::gitcreds_set()
# if you dont have a pat you can use
usethis::create_github_token()
# if you need add your PAT
usethis::edit_r_environ()
# generate your readme
usethis::use_readme_rmd()
# Edit and upload to git
usethis::use_github()

lets get the dataset

Variables:

  • lon: Longitude in decimal degrees
  • Lat: Latitude in decimal degrees
  • bio_1 to bio_19 bioclimatic variables as defined in worldclim
  • abund_sp1 to abund_sp4: abundance of species 1, 2 and 4

Basic rmarkdown

State the objective of the project in your readme

05:00

First look at the dataset

First look at the dataset (cont.)

First html report

Basic rmarkdown